#include <iostream>
#include <stdio.h>
#include <cmath>

using namespace std;

int main() {
    int a =0 ,b = 0;
    int n = 0;
    cin >> a;
    while(pow(10,n) <= a){
        b += (int)(a / pow(10,n)) % 10;
        n += 1;
    }
    cout << b;
    return 0;
}